package com.amin.app.web.service;

import com.amin.app.web.entity.SMenu;
import com.amin.app.web.mapper.MenuMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuSerivce {
    final
    MenuMapper menuMapper;

    public MenuSerivce(MenuMapper menuMapper) {
        this.menuMapper = menuMapper;
    }

    public void save(SMenu sMenu) {
        menuMapper.save(sMenu);
    }

    public List<SMenu> getMenuList(SMenu sMenu) {
        return menuMapper.getMenuList(sMenu);
    }

    public SMenu getMenuById(Integer id) {
        return  menuMapper.getMenuById(id);
    }

    public void delById(Integer id) {
        menuMapper.delById(id);
    }

    public void update(SMenu sMenu) {
        menuMapper.update(sMenu);
    }

    public List<SMenu> getMenuListByMenu() {
        return menuMapper.getMenuListByMenu();
    }

    public SMenu getMenuByIdByMenu(Integer id) {
        return  menuMapper.getMenuByIdByMenu(id);
    }

    public List<SMenu> getMenuButtonListByMenuId(Integer id) {
        return menuMapper.getMenuButtonListByMenuId(id);
    }
}
